/**
 * Copyright (c) 2024 watereyes
 * workflow is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.business.web;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.koron.business.bean.DealBean;

public interface DealMapper {
	@Select("SELECT `id` as msgid,`title` as msgtitle,`link` as msglink,`user` as useraccount,`type`,`sysid`,`createtime` as msgtimestamp,`msgstate` "
			+ "FROM `tblmessage` where `msgstate` = #{msgState} and `user` =#{userAccount} limit #{offset},#{pageSize}")
	public List<DealBean.Data> list(@Param("userAccount") String userAccount, @Param("offset") int offset,
			@Param("pageSize") int pageSize, @Param("msgState") int msgState);

	@Select("SELECT count(0) FROM `tblmessage` where `msgstate` = #{msgState} and `user` =#{userAccount} limit #{offset},#{pageSize}")
	public Integer listCount(@Param("userAccount") String userAccount, @Param("offset") int offset,
			@Param("pageSize") int pageSize, @Param("msgState") int msgState);
}